{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Day12 进阶构图元素——图例篇（上）\n",
    "\n",
    "　　在前面的日程中我们相继学习了`matplotlib`中的一些基础绘图元素，以及**散点图**、**折线图**以及**柱状图**三种使用的非常高频的图表类型，今天开始往后三天的日程安排中，我们分上中下篇来学习`matplotlib`中较为进阶的构图元素——**图例**。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.020075Z",
     "iopub.status.busy": "2020-10-27T14:10:17.020075Z",
     "iopub.status.idle": "2020-10-27T14:10:17.200631Z",
     "shell.execute_reply": "2020-10-27T14:10:17.200631Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.020075Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "matplotlib版本： 3.3.2\n"
     ]
    }
   ],
   "source": [
    "import matplotlib;print('matplotlib版本：', matplotlib.__version__)\n",
    "import matplotlib.pyplot as plt # 从matplotlib中导入我们最经常使用的pyplot子模块\n",
    "\n",
    "plt.rcParams['font.sans-serif'] = ['SimHei'] # 设定默认字体为SimHei以解决中文显示乱码问题\n",
    "plt.rcParams['axes.unicode_minus'] = False # 解决图像负号'-'不正常显示的问题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "　　在`matplotlib`中设置图例最基础的方式是在`plot()`、`scatter()`、`bar()`等叠加图层的时候添加参数`label`，相当于为当前的图层绑定一个`label`参数指定名称的图例成员，最后再利用`legend()`方法激活所有检测到的图层图例，就像下面的例子一样："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.202587Z",
     "iopub.status.busy": "2020-10-27T14:10:17.201590Z",
     "iopub.status.idle": "2020-10-27T14:10:17.405046Z",
     "shell.execute_reply": "2020-10-27T14:10:17.405046Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.201590Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdsAAAD2CAYAAACePy1oAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAApn0lEQVR4nO3deXhU5cH+8e8zmZAFAmELSyAkyKpsQoogKmGrYrGiolgRpVVxoaL41lpfqi+txfbnAoggggtgSyuiiK0bBAQBQRFkX5KwhoQtLIGQfWae3x8BKm4JJJOTydyf6+Iic3Jy5j4HkjtnfYy1FhEREfEfl9MBREREqjuVrYiIiJ+pbEVERPxMZSsiIuJnKlsRERE/c1fkwho0aGDj4+MrcpEiIiJV2rp1645aaxv+1DwVWrbx8fGsXbu2IhcpIiJSpRlj9pU2jw4ji4iI+JnKVkRExM9UtiIiIn6mshUREfEzla2IiIifqWxFRET87CfL1hjjNsakG2OWnfnTsbKCVbg5cyA+Hlyukr/nzHE6kYiIYxasz6TX3z4j4Q8f0etvn7FgfabTkaq10u6z7QT8y1r7RGWE8Zs5c2DkSMjLK3m9b1/Ja4Bhw5zLJSLigAXrM3ly/mbyi70AZGbn8+T8zQAMvjzWyWjVVmmHkXsANxljVhpj5hhjKvQhGJVm7Nj/Fu1ZeXkl00VEgszfPtlxrmjPyi/28vzCFIcSVX+llefXQG9r7UFjzFTgeuDf357BGDMSGAkQFxfnl5Dllp5+YdNFRKqicXXK9eVHbDSveH7JcW8/QjEMDVnKKPcHNDHHS2YoAMaVL2LHhCraA2dsvnuzI+9bWtlustYWnvl4B9D6uzNYa2cAMwASExNtxcarIHFxJYeOf2i6iEg1d9TWZrpnEG95f46HEIaELOe3Ie/T3HXU6WhBo7Sy/bsxZjywBbgJeNb/kfxg/Pjzz9kCREaWTBcRqaZO2FrM8PyC2d5rKaAGg10recQ9nxauI05HCzqlle2fgX8CBvi3tXax/yP5wdmLoMaOLT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rvP6TyByBjzhDHmrjMvoynZq5AL0x8YZYxZBnQxxrzucJ5A9HdjTGdjTAhwE7DR6UABaifQ8szHicCP/lwMuvtsjTHLrLVJTucIRMaYB4Fn+e835jRr7VwHIwWcMxfqvQOEAVuAUTbYvgkrkL6fL44xpgPwT8AA/7bWjnU4UkAyxkQBbwKNgFBgiLU28wfn1fe5iIiIf+kwsoiIiJ+pbEVERPxMZSsiIuJnKlsRERE/U9mKiIj4mcpWRETEz/4/mppCOGt9HswAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 576x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(8, 4))\n",
    "\n",
    "x = np.array(range(1, 6))\n",
    "\n",
    "ax.scatter(x, x, label='散点图')\n",
    "\n",
    "ax.scatter(x, x[::-1], color='red')\n",
    "\n",
    "ax.plot(x, x, label='折线图')\n",
    "\n",
    "ax.bar(x, x, width=0.5, label='柱状图1')\n",
    "\n",
    "ax.bar(x+0.5, x, width=0.5, label='柱状图2')\n",
    "\n",
    "ax.legend(); # 激活先前由label参数绑定的所有图层"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "　　可以看到，在上面的例子中我们的所有写了`label`参数的图层都在图例中显示了出来，事实上，完整的`legend()`最基础的使用格式应为`ax.legend(handles, labels)`，只是上面的例子这种方式可以自动检测并激活图例。\n",
    "  \n",
    "　　在这种机制下，嘿嘿，配合`Axes`对象的`get_legend_handles_labels()`方法，我们甚至可以把一张图上的图例“移花接木”到另一张图上~"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.406044Z",
     "iopub.status.busy": "2020-10-27T14:10:17.406044Z",
     "iopub.status.idle": "2020-10-27T14:10:17.527717Z",
     "shell.execute_reply": "2020-10-27T14:10:17.527717Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.406044Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATsAAAEtCAYAAAB3U8dBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAX2ElEQVR4nO3df2zV9b3H8eebUqT+mBUoja1xmAUrm8CYJw6QYUcgVfRmwNVLrtvUzI3tqsvikkaIuKtGr+bi1SybTgi6GPwxSehtyNXdxl5oxAmLZeWHRut04taio3MWBhyllvf945xCKac937bfwznl83okDd9+v+9+P+8PbV/9/mjP19wdEZHT3ah8NyAicioo7EQkCAo7EQmCwk5EgqCwE5EgKOxEJAij8zHohAkTfNKkSfkYWkROY9u3b/+bu5dl2paXsJs0aRLNzc35GFpETmNm9kF/23QaKyJBUNiJSBAUdiIShLxcs8ukq6uLtrY2Pv3003y3UlDGjh3LBRdcQHFxcb5bERnRCibs2traOOecc5g0aRJmlu92CoK78/HHH9PW1sZFF12U73ZERrSCOY399NNPGT9+vIKuFzNj/PjxOtoViUHBhB2goMtA/yci8SiY09hCcPToUcaNG0cikQBSp5G9w6alpYW2tjZKSkpO+tiHHnqIGTNm8Mwzz3DPPffwpS99iYULF/LrX/+a8vLyjOPNmTOHuro6Jk6cmJsJiYxQ9S3trGpoZW9nkorSEmprqlg0o3JY+xww7MxsNPCn9BvAj919d4a6e4GFwO/d/fZhdZRHo0aNYtq0aTQ2NvKXv/yFm2++mcbGxmPb58+fz5gxY/jrX//Kddddx5YtWwDYuHEj69evp7Gxkffff5877riDp556ik8++YTy8nLcHXdn1KgTD6RHjx7N9ddfT3FxMe7O+PHjWb9+/Smds0ihqW9pZ0XdbpJd3QC0dyZZUZeKneEEXrYju2nA8+5+Z38FZpYA5gCXA3ea2Xx3b+yvPi65SH5IBZ67c+utt5JMJqmurua9997jnXfeAeDAgQPcdNNNHDp06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qiZJUg99uFyoM3M5g9loIIKO2J6bONQRXyS2m+B2e4+C7jYzKbFNHaUsKnm+Nw3cfy5H7Exs1nAee6+LcPm14Er3X0O0AksjGvciIFTTY7mb2ZG6muvi9TXYV85m3t6/GxhU03u5j4G+BmwfICyXM0/SojOBTZ46m5qI/CNoQxUUGEX12Mbc+w1d/9HevltIO6fsAOFTU7nbmbjgF8A/V0e2OXuH6aXczH3bIGTs/l7ym2kfoBem6EkZ3OPGDa5/NwvBx5z984BanI1/yghGsvcCyrsIsrJYxsHocHMzjezM4Ea4I24dhwhbHI29/Q33HpgRfqZIpmsM7PpZlYELAZ2xjU+RAqcnMzfzO40sxvT75aS+qbrK5dzjxI2ufy6nw/cZmZNwFfNbG2GmlzNP0qIxjL3kRh2OXlsYyZmNs/Mbu+z+l5gM7ANeMLdW2MaK0rY5HLutwCXAXelLxT/u5nd36fmPmAdsAPY6u6NcQ0eMXByNf81wHfN7BWgiNR1oVM2d6KFTc4+9+4+t+eaGan5PXIK5x8lRGOZe0H+UrGZNbl7tWV4bKOZfRF4idS5+2xg5unwNDMz+zfgPzj+yd4MFLv7yl41XwC2AP8HXE1q7tlO+0eE9M2p9cAZpI6WHwP+NZT590gH3q3ADSHM3cwuBZ4DDNgI/Bfwn+7+/V41o0jNvZnUjbur3P39QY9ViGGXjZlVkEr6htPhEz4Y6VBYALzi7v1dzD5thTz/wOdeAlwD/MHd/zSkfYzEsBMRGayReM1ORGTQFHYiEgSFnYgEQWEnIkFQ2IlIEP4fkhnJx7pOGIAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax1 = plt.subplots(figsize=(5, 5))\n",
    "\n",
    "ax1.scatter(x, x, label='图1散点')\n",
    "\n",
    "ax1.legend()\n",
    "\n",
    "handles, labels = ax1.get_legend_handles_labels()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.529712Z",
     "iopub.status.busy": "2020-10-27T14:10:17.528716Z",
     "iopub.status.idle": "2020-10-27T14:10:17.624460Z",
     "shell.execute_reply": "2020-10-27T14:10:17.624460Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.529712Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1f0ac198c18>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUIAAAEwCAYAAADCR3hWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAARoUlEQVR4nO3cfYxV5Z3A8e8PGMoIKALDNIPt1nYp1S0qdWKV4mYkkmpfomWhmDZaW7fUbbVNm5BgVhvTmLaxjc2mWysUaU1oN7KRsvYtBMJOikF3dwjSLqVUjNjOGApFZBYGlcqzf8yVl2FeDsO5l2Ge7ychHLjPPf7ODH5zzj33TqSUkKScjTjbA0jS2WYIJWXPEErKniGUlD1DKCl7hlBS9gyhpOwVCmFENEbExn4er4uIn0fEpoj4THnjSVL1DRjCiLgQeAwY28+yu4G2lNIs4CMRMb6k+SSp6kYVWPMGsBD4j37WtABLKtubgGbgP09cEBGLgEUAY8eOvfI973nP6c4qSf3avHnzX1JKDaf7vAFDmFLqBIiI/paNBToq251AYy/7WQYsA2hubk5tbW2nO6sk9SsiXhzM88q6WXIQqK9sjytxv5JUdWUFazMwu7J9ObCrpP1KUtUVeY3wJBExB7g0pfSvJ/z1Y8AvI+Ja4FLgv0qaT5KqrnAIU0otld83ABt6PPZiRMyl+6zwqymlN8ocUsrVkSNHaG9v59VXXz3bowwpY8aM4aKLLqKurq6U/Z32GWFfUkovAavK2p8kaG9vZ/z48bzjHe8Y6IZlNlJK7Nu3j/b2di6++OJS9ulNDWkIe/XVV5k0aZIRPEFEMGnSpFLPkg2hNMQZwVOV/TUxhJKyV9prhJKGp6NHjzJx4kSam5uB7tfoTjwj27JlC+3t7dTX15/y3G9+85vMnDmTlStXcv/99/Oud72LD33oQ/zwhz+ksfGUz10AMHv2bFavXs2UKVOqc0C9MITSMLJmSwffWruDl145TNOEehZ/cDo3z5x6RvscMWIEl112GevXr+dPf/oTt99+O+vXrz/2+PXXX8/o0aP585//zPz589m4sfvnszz55JOsWrWK9evX88ILL/DlL3+ZFStWsH//fhobG0kpkVJixIiTL0xHjRrFggULqKurI6XEpEmTWLWquvdhDaE0TKzZ0sE9q3/L4SPd717reOUw96z+LUApMUwp8fnPf57Dhw/T0tLC888/zx/+8AcAOjs7+dSnPsWhQ4eOPee6665j+/btXHbZZfzkJz9h8eLFPPHEExw8eJCrrrqKrq4uli5dygc+8IFT/ntPPPEEkydPPqOZT4chlIaJb63dcSyCbzp85A2+tXbHGYcQ4LHHHmPSpEmMGTOGKVOmcP/99x+7HB45ciSPP/44N91007H169evZ/To0ezYsYMrr7ySJ598kuXLl/OlL32JpqYmIuJYBJ966ikWLFjA9OnTAZg/fz4Azz77LLt27WLChAlnPH9/DKE0TLz0yuHT+vvTdeONNxIRPP744+zcuZOnn36aCy64AIDzzz//lPUf+9jHeO9738vkyZPp6uri3e9+N4888girV6+mq6uLOXPmHFs7evRoPvzhD7N8+fKT9tHS0sJb3vKWUubvjyGUhommCfV09BK9pgmn3sQYjLVr13LeeedxzTXX0NHRwZQpU9i2bVu/z5k4cSI333wze/bs4eWXX+aGG27gxz/+Ma2trSxevPjYutdff51f/OIXtLS0nPT8Z599ltdff73XGzFlMoTSMLH4g9NPeo0QoL5uJIs/OL2U/d92221s2rSJtrY2ZsyYwcKFCxk3bhw/+tGP+nxOV1cXa9asoauri/e9730AXHLJJbzwwgsnfTxu586dbNu2jd27d3PppZfS1tbGFVdcwcsvv0x7e/uxM89q8X2E0jBx88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OxtYm/p5TdFPlkjK3rl0c0KSqsIQSsqeIZSUPUMoKXuGUFL2/h9Z/oDrs2HpwgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax2 = plt.subplots(figsize=(5, 5))\n",
    "\n",
    "ax2.legend(handles, labels)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "　　而基于前面说的`legend()`方法中的`handles`参数，我们可以把前面绘制的图层保存到指定变量中，再组成`handles`列表传入`legend()`达到只显示指定图层图例的作用："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.625472Z",
     "iopub.status.busy": "2020-10-27T14:10:17.625472Z",
     "iopub.status.idle": "2020-10-27T14:10:17.761124Z",
     "shell.execute_reply": "2020-10-27T14:10:17.761124Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.625472Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATEAAAEtCAYAAABgcVeIAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZ+ElEQVR4nO3df3TU9Z3v8eebJJDwGwIoP1TY25XqiorOcYEqTTFIf3Ba9Lalt7osqxx/wNJz9JpW6ta1PUWPpZXjqajluivWeiyuIl1oJStXKbcC0olR0Yt4sbdqwnJNhYjAQCB53z9mQJJMyMD8/Exej3PmZObz/ebzeX+SySvfHzPfMXdHRCRUvfJdgIhIOhRiIhI0hZiIBE0hJiJBU4iJSNAUYiIStNJMdjZs2DAfO3ZsJrsUEaGuru4v7j482bKMhtjYsWOJRqOZ7FJEBDN7r6tl2p0UkaApxEQkaAoxEQlaRo+JJXPkyBEaGho4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kMkm7/7RP/TgAPEn3vJZGv+3YajmUWAy4n/bhrMrPp0BsrVllgqIVIFPJ24vwnI2AvxuvvYuYTngSnuPhk418wuzNDYqYRIFZ/O/UXiv9iMMrPJwBB335Jk8R+Bz7v75UAz8OVMjZtikFSRpfmbmRF/7h0h/jzsKGtzT4zfXYhUkb259wbuAk52IftszT+VcJwKPOvxs4vrgStOZ6CchFiKIdIPaEzc3weckd2qOtnk7p8k7r8NZPo/4slCJKtzN7OhwM+BrnbT33D3/0zcz8bcuwuSrM3f4xYQ/8c4M8kqWZt7iiGSzd/9HcAyd28+yTrZmn8q4ZiRuRfSgf39fLrJ3Z/c11ZrZiPNrC8wA3gzUx2nECJZm3viD+lpYJG7d/W+1ifM7CIzKwGuBl7P1PiQUpBkZf5m9j0zm5N4OJj4H1NH2Zx7KiGSzed9NbDAzDYAF5vZo0nWydb8UwnHjMy9kEKsjk83pS8C/pytgcxsmpn9Y4fmHwIvAVuAR9x9R4bGSiVEsjn3G4BLgTsTB1j/2cx+3GGdHwFPAK8Bm919faYGTzFIsjX/5cDfmdlGoIT4cZeczZ3UQiRrv3t3n3rsmBTx+d2fw/mnEo6Zmbu75+wGbEh8nQb8Y4dl5wBvAQ8Q3xQtyWVtWZzzLcBeYEPi9s/AjzusMzDxS74f2A4MynfdGZz/EOAFYCPwEPED/T1m/ifMcQNwfk+ZO3AB8AawDVgMDAUe7bBOL+DlxN/8DmDc6YxVUK/YN7NRxJO51rs/hlZUEmdwpwMb3b2rg8BFqyfPv4fPvQL4CvCqu//ptPoopBATETlVhXRMTETklCnERCRoCjERCZpCTESCphATkaD9fytA2LfdGf8UAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(5, 5))\n",
    "\n",
    "line1 = ax.scatter(x, x, label='图1散点')\n",
    "line2 = ax.scatter(x, x[::-1], label='图2散点', color='red', linestyle='--')\n",
    "line3 = ax.scatter(x, x+1, label='图3散点', color='yellow', linestyle='--')\n",
    "\n",
    "ax.legend(handles=[line2, line3]);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "　　到现在我们了解到图例中的`handles`其实就是不同的点\n",
    "  、线、面图层对象，因此就算没有绘制出实际的图层，我们也是可以自己制作对应图例的`handles`与`labels`："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.762092Z",
     "iopub.status.busy": "2020-10-27T14:10:17.762092Z",
     "iopub.status.idle": "2020-10-27T14:10:17.878779Z",
     "shell.execute_reply": "2020-10-27T14:10:17.878779Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.762092Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAUUAAAEtCAYAAACf03JqAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAOPklEQVR4nO3cUWiddZrH8d9v24aUVt3axrqlxBYsMs5F3Z3DUEsZo1hQ2IuhipaRXS9mqFTxYr1ZxeIyTMUbKYjYxWIu9sKBFMTezOrSpRss1F4kDF7M7oU3FVKoZmpsaKGoy7MXOd082z1J3vc973tOTvv9QOEk5/+e5z3JybfvmzeJI0IAgAV/0e8dAIDVhCgCQEIUASAhigCQEEUASIgiACRr+70Dy9myZUvs2LGj37sB4BYzPT3954gY6XTfqo7ijh07NDU11e/dAHCLsf3VUvdx+gwACVEEgIQoAkCyqr+nCGB1++GHHzQzM6Pr16/3e1c6Gh4e1vbt27Vu3brC2xBFAJXNzMzojjvu0I4dO2S737vzf0SELl++rJmZGe3cubPwdpw+A6js+vXr2rx586oLoiTZ1ubNm0sfxRJFAF1ZjUG8ocq+cfoMoDb+bb2BjH8q9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f8Xs0e6CgCQN0G+XuKAFA7oggACVEEgIQoAkBCFAEg+R8rii60JAJUlQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(5, 5))\n",
    "\n",
    "handles = [\n",
    "    plt.bar([0], [0], color='green'),\n",
    "    plt.bar([0], [0], color='yellow')\n",
    "]\n",
    "\n",
    "ax.legend(handles=handles, labels=['1', '2']);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 课后测验：\n",
    "\n",
    "　　通过今天的学习，我们对`matplotlib`的创建机制有了一定了解，既然我们知晓了如何分别从已经绘制出的图层以及自定义的`handles`中分别创建图例，那么将它们结合也是可以做到的，请你在下面代码的基础上，把图层和自定义`handles`中的所有`handles`结合到一个图例中（两个`bar`的`label`信息分别命名为`bar1`和`bar2`）："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2020-10-27T14:10:17.879778Z",
     "iopub.status.busy": "2020-10-27T14:10:17.879778Z",
     "iopub.status.idle": "2020-10-27T14:10:17.988521Z",
     "shell.execute_reply": "2020-10-27T14:10:17.988521Z",
     "shell.execute_reply.started": "2020-10-27T14:10:17.879778Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWkAAAFjCAYAAAD/4PooAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAhOElEQVR4nO3deXhU1eH/8c/JDiGJkIUdWUXZZAkBLZVoVWy1WndciARxabVW+7PV1rZq++1uXeuWKqv73qpFWhe2Ioawo4ICCoQ1QBIgIWQyc35/QK0ikCHM5Ny58349T54nYcLM50Lyycm559xrrLUCAH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cxau9Z1nkgzxtxmjCna/+Ex2jcS85PTJd1gjJkhaaAx5gnHeaJhqjHmRGNMoqTzJS2J5JP7vbTY0h77rpY0RNId+8+cX+o6UISVSBpjjJklKVHSvxzniShr7Sn/PaEmabG1drzrTFHwa0lTJS2W9L619u1IPrmvN7MYYzIlzZb0jvZvaY+H+VsA/uHrkpa+WKJ2hqRZ1lq/nl0G4FO+L2kAiGV+n5MGgJhGSQOAh1HSAOBhlDQAeBglDQAe9v8Bl9d2aoyrofUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(6, 6))\n",
    "\n",
    "og_handles = [\n",
    "    plt.bar([0], [0], color='black'),\n",
    "    plt.bar([0], [0], color='grey')\n",
    "]\n",
    "ax.plot(x, x, linestyle='--', label='line')\n",
    "#获取handles\n",
    "handles,labels = ax.get_legend_handles_labels()\n",
    "#列表增加handles和lables\n",
    "og_handles=og_handles+handles\n",
    "og_labels=['bar1','bar2']+labels\n",
    "ax.legend(handles=og_handles,labels=og_labels);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 请在今天对应的帖子下回复补充过注释的代码截图"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 2,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
